package com.sd365.permission.centre.dao.mapper;

import com.sd365.common.core.common.dao.CommonMapper;
import com.sd365.permission.centre.entity.UserRole;

import java.util.List;

public interface UserRoleMapper extends CommonMapper<UserRole> {

    List<UserRole> selectByRoleId(Long id);


    /**
     * 根据通过角色id删除全部相关联的数据
     * @param roleId
     * @return
     */
    int deleteAllByRoleId(Long roleId);

    List<UserRole> selectByUserId(Long id);

    Integer deleteAllByUserID(Long id);
    int haveUserRole(UserRole userRole);
    UserRole selectUserRoleByUseridTenantid(Long userId, Long tenantId);

}